package spring.jpa.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import spring.jpa.entity.Customer;
import spring.jpa.repository.CustomerRepository;
import spring.jpa.repository.springdata.CustomerRepositorySpringData;
import spring.jpa.service.CustomerService;

@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerRepository customerRepository;

    @Autowired
    private CustomerRepositorySpringData customerRepositorySpringData;

    @Override
    public void save(Customer customer) {
        customerRepository.save(customer);

        customerRepositorySpringData.save(customer);
    }
}